package com.core.redis.listener;

import org.apache.log4j.Logger;

import redis.clients.jedis.JedisPubSub;

public class MyListener extends JedisPubSub{

	private static Logger logger = Logger.getLogger(MyListener.class);
	
	public void onMessage(String channel, String message){
		logger.info("取得订阅:"+channel+"消息："+message);
	}
	
	public void onSubscribe(String channel, int subscribedChannels){
		logger.info("初始化订阅"+channel+"="+subscribedChannels);
	}
	
	public void onUnSubscribe(String channel, int subscribedChannels){
		logger.info("取消订阅"+channel+"="+subscribedChannels);
	}
	
	public void onPSubscribe(String pattern, int subscribedChannels){
		logger.info("初始化按表示式订阅"+pattern+"="+subscribedChannels);
	}
	
	public void onPUnSubscribe(String pattern, int subscribedChannels){
		logger.info("取消按表达式订阅"+pattern+"="+subscribedChannels);
	}
	
	public void onPMessage(String pattern, String channel, String message){
		logger.info("取得按表达式订阅"+pattern+"="+channel+"="+message);
	}
	
}
